﻿using System;
using OdaOperation.Model;

namespace OdaOperation.Core.Parameters
{
    public class TableLabelParameter : AbstractParameter
    {
        public const double DefaultAngle = Math.PI / 4.0;

        public const double DefaultFontSize = 3.75;

        public const string DefaultFontStyle = "F-HZTXT";

        public double Angle { get; set; } = Math.PI / 4.0;


        public double Length1 { get; set; }

        public double Length2 { get; set; }

        public string FontStyle { get; set; } = "F-HZTXT";


        public TableData TableData { get; set; }

        public TableSize TableSize { get; set; }

        public double FontSize { get; set; } = 3.75;


        public override void Check()
        {
            base.Check();
            if (Length1 <= 0.0)
            {
                throw new ArgumentNullException("Length1必须大于0");
            }

            if (Length2 <= 0.0)
            {
                throw new ArgumentNullException("Length2必须大于0");
            }

            if (TableData == null)
            {
                throw new ArgumentNullException("TableData");
            }

            if (TableSize == null)
            {
                throw new ArgumentNullException("TableSize");
            }
        }
    }
}